<div class="flat_area grid_16">
    <h2>Dashboard</h2>
</div>
<div class="box grid_16">
    <h2 class="box_head grad_colour round_top">Activation Cards</h2>
    <a href="#" class="grabber">&nbsp;</a>
    <a href="#" class="toggle">&nbsp;</a>
    <div class="toggle_container">
        <div class="wizard">		
            <div class="wizard_steps">
                <ul class="clearfix">
                    <li class="current">
                        <a href="#daily" class="clearfix">
                            <span><strong>Daily</strong></span>
                            <small>Daily Activation Cards</small>
                        </a>
                    </li>
                    <li>
                        <a href="#monthly" class="clearfix">
                            <span><strong>Monthly</strong></span>
                            <small>Monthly Activation Cards</small>
                        </a>
                    </li>
                    <li>
                        <a href="#summary" class="clearfix">
                            <span><strong>Summary</strong></span>
                            <small>Summary Activation Cards</small>
                        </a>
                    </li>
                </ul>		
            </div>
        </div>
        <div class="block grid_16 alpha omega wizard_content">
            <div id="daily" class="step" style="display:block;">
                <?php
//                echo '<pre>';
//                print_r($jml_distributor);
//                echo '</pre>';
//                echo '<pre><h1>DATA DUMMY</h1>';
//                print_r($arr_data1);
//                echo '</pre>';
//                exit;

                $this->Widget('application.extensions.highcharts.HighchartsWidget', array(
                    'options' => array(
                        'chart' => array('defaultSeriesType' => 'column'),
                        'title' => array('text' => 'Laporan Aktivasi Harian'),
                        'xAxis' => array(
                            'categories' => $tanggal,
                            //'categories' => array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'),
                            'labels' => array('rotation' => '-45')
                        ),
                        'yAxis' => array(
                            'title' => array('text' => 'Jumlah')
                        ),
                        'series' => array(
                            array('name' => 'Distributor', 'data' => $jml_distributor),
                            array('name' => 'Factory', 'data' => $jml_factory),
                            array('name' => 'Warehouse', 'data' => $jml_warehouse)
                        )
                    )
                ));

//                 echo '<pre>';
//                print_r($jml_distributor);
//                echo '</pre>';
//                echo '<pre>';
//                print_r($arr_data2);
//                echo '</pre>';
                ?>
            </div>

            <div id="monthly" class="step">
                <?php
                $this->Widget('application.extensions.highcharts.HighchartsWidget', array(
                    'options' => array(
                        'title' => array('text' => 'Laporan Aktivasi Bulanan    '),
                        'xAxis' => array(
                            'categories' => $monthly_data['tanggal'],
                        ),
                        'yAxis' => array(
                            'title' => array('text' => 'Jumlah')
                        ),
                        'series' => array(
                            array('name' => 'Distributor', 'data' => $monthly_data['jumlah']['distributor']),
                            array('name' => 'Factory', 'data' => $monthly_data['jumlah']['factory']),
                            array('name' => 'Warehouse', 'data' => $monthly_data['jumlah']['warehouse'])
                        )
                    )
                ));
                ?>
            </div>

            <div id="summary" class="step">
                <?php
                $this->widget('zii.widgets.grid.CGridView', array(
                    'id' => 'sys-network-level-status-log-grid',
                    'dataProvider' => $dataProviderIncome,
                    'columns' => array(
                        array(
                            'header' => 'Jenis Aktivasi',
                            'name' => 'network_level_status_log_value',
                            'value' => '$data["network_level_status_log_value"]',
                            'htmlOptions' => array('style' => 'text-align:center;'),
                        ),
                        array('header' => 'Jumlah Aktivasi',
                            'value' => '$data["Jumlah"]',
                            'htmlOptions' => array('style' => 'text-align:center;'),
                        ),
                        array('header' => 'Total Pemasukkan (Rp)',
                            'value' => '
                                    number_format(($data["network_level_status_log_value"]=="distributor")?100000*$data["Jumlah"]:(
                                    ($data["network_level_status_log_value"]=="warehouse")?600000*$data["Jumlah"]:(
                                    ($data["network_level_status_log_value"]=="factory")?6000000*$data["Jumlah"]:0*$data["Jumlah"])),0,",",".")',
                            'htmlOptions' => array('style' => 'text-align:center;'),),
                    ),
                    'pager' => array(
                        'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-pager.css',
                        'header' => '',
                        'firstPageLabel' => 'First',
                        'prevPageLabel' => 'Previous',
                        'nextPageLabel' => 'Next',
                        'lastPageLabel' => 'Last',
                    ),
                    // 'selectableRows' => 2,
                    // 'selectionChanged' => 'userClicks',
                    'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-gridview.css',
                ));
                ?>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
	
    // wizard
    $('.wizard_steps ul li a').click(function(){
	
        $('.wizard_steps ul li').removeClass('current');
        $(this).parent('li').addClass('current');
		
        var step = $(this).attr('href');
        var step_num = $(this).attr('href').replace('#step_','');
        var step_multiplyby = (100 / $(".wizard_steps > ul > li").size());
        var prog_val = (step_num*step_multiplyby);
		
        $( "#progressbar").progressbar({ value: prog_val });
		
        $('.wizard_content').children().hide();
        $('.wizard_content').children(step).fadeIn();
		
        return false;
    });
	
    $('button.next_step').click(function(){
		
        var step = $(this).attr('id');
        var hash_step = ('#'+step);
				
        var step_num = $(this).attr('id').replace('step_','');
        var step_multiplyby = (100 / $(".wizard_steps > ul > li").size());
        var prog_val = (step_num*step_multiplyby);
		
        $( "#progressbar").progressbar({ value: prog_val });
		
        $('.wizard_steps ul li').removeClass('current');
        $('a[href='+ hash_step +']').parent().addClass('current');
		
        $('.wizard_content').children().hide();
        $('.wizard_content').children(hash_step).fadeIn();
		
        return false;		
    });
	

</script>

<?php

